import request from '@/utils/request'
import { Course, CourseDTO } from './type'
const baseUrl = '/course'

export const reqV2PageCourse = (
  pageNum: number,
  pageSize: number,
  queryParams: CourseDTO,
) =>
  request.post<any, TableResponse<Array<Course>>>(`${baseUrl}/v2/page`, {
    pageSize,
    pageNum,
    ...queryParams,
  })

export const reqCourseAndDespAndTeacherAndChapterAndCommentV2 = (
  courseId: string,
) => request.get<any, ResponseData>(`${baseUrl}/v2/${courseId}`)

export const reqV2Index12 = () =>
  request.get<any, TableResponse<Array<Course>>>(`${baseUrl}/v2/index12`)
